﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using DotNetOpenAuth.AspNet.Clients;
using DotNetOpenAuth.OpenId;
using Microsoft.AspNet.Membership.OpenAuth;

namespace WebTriple7.Class
{
    public static class AuthConfig
    {
        public static void RegisterOpenAuth()
        {
            // See http://go.microsoft.com/fwlink/?LinkId=252803 for details on setting up this ASP.NET
            // application to support logging in via external services.

           // OpenAuth.AuthenticationClients.AddTwitter(
            //    consumerKey: "your Twitter consumer key",
            //    consumerSecret: "your Twitter consumer secret");

            var str_faceAppId = Config.Global.Settings.GetAppKeyValue("facebook_appid");
            if (!string.IsNullOrWhiteSpace(str_faceAppId))
            {
                OpenAuth.AuthenticationClients.AddFacebook(
                    appId: Config.Global.Settings.GetAppKeyValue("facebook_appid"),
                    appSecret: Config.Global.Settings.GetAppKeyValue("facebook_appsecret")
                    );
            }
            //  OpenAuth.AuthenticationClients.AddMicrosoft(
           //     clientId: "your Microsoft account client id",
           //     clientSecret: "your Microsoft account client secret");

            OpenAuth.AuthenticationClients.AddGoogle();
            OpenAuth.AuthenticationClients.Add("Yahoo", () => new YahooOpenIdClient());            
        }
    }
}